home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 16.7 KB | 562 lines | [TEXT/MPS ] |
- //========================================================================================
- // File: Views.fr
- // Release Version: $ ODF 1 $
- //
- // Contains: Resources defining the Form part's views
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //========================================================================================
-
- #ifndef FWRESFIL_K
- #include "FWResFil.k"
- #endif
-
- #ifndef FWVIEWS_FR
- #include "FWViews.fr"
- #endif
-
- #ifndef FWNOTDEF_H
- #include "FWNotDef.h"
- #endif
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- //========================================================================================
- // Defines
- //========================================================================================
-
- // H & V are reference size for the Form frame.
- // Their values are not important because all the views will be resized at runtime
- // to adjust to the real frame size defined by the part. What is important is the
- // placement of the subviews relative to this reference size and their binding flags.
- // Note: in this example the bounds & bindings of RFormView, the content view, are not
- // important either because the frame takes care of it in CFormView::CenterInFrame()
-
- #define H FW_FIX(600)
- #define V FW_FIX(1000)
-
- #define H1 H + FW_FIX(1)
- #define V1 V + FW_FIX(1)
-
- // Fonts not defined in "FWViews.fr"
- #define TIMES_12_BOLD { FW_FIX(12), FW_kBold, "Times" }
-
- //========================================================================================
- // type RFormView
- //========================================================================================
-
- type RFormView : FW_RSuperView(Label='Frmv')
- {
- // This form uses 3 radio-clusters (not included in FW_RSuperView)
- // The code to load them is in CFormView::InitializeFromStream().
-
- FW_RRadioCluster;
- FW_RRadioCluster;
- FW_RRadioCluster;
- };
-
- //========================================================================================
- // type RScrollEdit
- //========================================================================================
- // Custom scrolling edit view
-
- type RScrollEdit : FW_REditView(Label='Sedv')
- {
- HorizViewID:
- longint; // Horizontal scrollbar id, or 0 for no scrollbar
- VertViewID:
- longint; // Vertical scrollbar id, or 0 for no scrollbar
- TextWidth:
- FW_RFixed; // text width (or 0 to use same width as view)
- };
-
- //========================================================================================
- // resource RFormFrame(kFormView)
- //========================================================================================
- // See constants in "FWViews.k", macros & resource types in "FWViews.fr"
-
- resource FW_RFrameLayout(kFormView)
- {
- {H,V}, // LayoutSize
- { // Start list of frame's subviews
- RFormView
- (
- kFormViewID, // view id
- {0, 0, H, V}, // bounds
- FW_kFitToEnclosure, // bindings
- {FW_FIX(560),FW_FIX(800)}, // extent
- 1, // Make it the ContentView
- FW_kXYScrolling, // scrolling direction
- { // Start list of SubViews
- FW_REditView // First name
- (
- kFirstNameEdViewID, // view id
- { FW_FIX(290),FW_FIX(90),FW_FIX(450),FW_FIX(107)},
- FW_kFixedBounds, // binding
- 20, // max chars
- 9, // attributes
- TIMES_12_BOLD,
- "" // initial text
- ),
- FW_REditView // Last name
- (
- kFirstNameEdViewID + 1, // view id
- { FW_FIX(290),FW_FIX(110),FW_FIX(450),FW_FIX(127)},
- FW_kFixedBounds, // binding
- 20, // max chars
- 9, // attributes
- TIMES_12_BOLD,
- "" // initial text
- ),
- FW_REditView // member name
- (
- kFirstNameEdViewID + 2, // view id
- { FW_FIX(290),FW_FIX(130),FW_FIX(450),FW_FIX(147)},
- FW_kFixedBounds, // binding
- 20, // max chars
- 9, // attributes
- TIMES_12_BOLD,
- "" // initial text
- ),
- FW_REditView // e-mail address
- (
- kFirstNameEdViewID + 3, // view id
- { FW_FIX(290),FW_FIX(150),FW_FIX(450),FW_FIX(167)},
- FW_kFixedBounds, // binding
- 30, // max chars
- 9, // attributes
- TIMES_12_BOLD,
- "" // initial text
- ),
- /**
- FW_RScrollBar // Horizontal scrollbar for text-edit
- (
- kEditHScrollBarID, // view id
- {FW_FIX(30), FW_FIX(289), FW_FIX(450), FW_FIX(305)}, // bounds
- FW_kFixedBounds, // view binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- 0, // SB Min Value (adjusted at runtime)
- 1, // SB Max Value (adjusted at runtime)
- FW_ONE, // SB Minor Units (adjusted at runtime)
- FW_ONE // SB Major Units (adjusted at runtime)
- ),
- **/
- FW_RScrollBar // Vertical scrollbar for text-edit
- (
- kEditVScrollBarID, // view id
- {FW_FIX(449), FW_FIX(200), FW_FIX(465), FW_FIX(290)}, // bounds
- FW_kFixedBounds, // view binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- 0, // SB Min Value (adjusted at runtime)
- 1, // SB Max Value (adjusted at runtime)
- FW_ONE, // SB Minor Units (adjusted at runtime)
- FW_ONE // SB Major Units (adjusted at runtime)
- ),
- RScrollEdit // Comments (custom scrolling edit view)
- (
- kFirstNameEdViewID + 4, // view id
- { FW_FIX(30),FW_FIX(200),FW_FIX(450),FW_FIX(290)},
- FW_kFixedBounds, // binding
- -1, // max chars (32K)
- 13, // attributes
- FW_NORMAL_FONT,
- "", // initial text
- 0, // kEditHScrollBarID, // Horizontal SB
- kEditVScrollBarID, // Vertical SB
- FW_FIX(600) // text width (used only with horiz SB)
- ),
- FW_RButton
- (
- kSubscribeCheckID, // view id
- { FW_FIX(30),FW_FIX(310),FW_FIX(200),FW_FIX(324)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 1, // control value
- FW_kCheckButton, // button kind
- TIMES_12_BOLD,
- "Subscribe to ODFFlash"
- ),
- FW_RGroupBox
- (
- 0, // view id
- { FW_FIX(30),FW_FIX(360),FW_FIX(220),FW_FIX(440)},
- FW_kFixedBounds, // binding
- TIMES_12_BOLD,
- "Modem speed used"
- ),
- FW_RButton
- (
- k14400RadioID, // view id
- { FW_FIX(40),FW_FIX(380),FW_FIX(210),FW_FIX(396)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- FW_kRadioButton, // button kind
- FW_SYSTEM_FONT,
- "14.4 Kbps or lower"
- ),
- FW_RButton
- (
- k28800RadioID, // view id
- { FW_FIX(40),FW_FIX(400),FW_FIX(210),FW_FIX(416)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 1, // control value
- FW_kRadioButton, // button kind
- FW_SYSTEM_FONT,
- "28.8 Kbps to 256 Kbps"
- ),
- FW_RButton
- (
- kFasterRadioID, // view id
- { FW_FIX(40),FW_FIX(420),FW_FIX(210),FW_FIX(436)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- FW_kRadioButton, // button kind
- FW_SYSTEM_FONT,
- "Faster than 256 Kbps"
- ),
- FW_RListBox
- (
- kPlatformListBoxID, // view id
- { FW_FIX(250),FW_FIX(362),FW_FIX(400),FW_FIX(440)},
- FW_kFixedBounds, // binding
- 10, // number of rows
- 1, // vertical SB
- 0, // single selection
- 1, // use focus frame
- 0, // use clientdata
- FW_kListBoxDoubleClickedMsg, // DblClick message
- FW_HELVETICA12, // font
- { // List of strings
- "Mac OS",
- "OS/2 Warp",
- "Windows 95",
- "Windows NT",
- "IBM AIX",
- "Sun Sparc Solaris",
- "Sun OS 4.1.x",
- "HP /UX",
- "Unix IRIX",
- "Unix Linux"
- }
- ),
- FW_RButton
- (
- kAddButtonID, // view id
- { FW_FIX(410),FW_FIX(370),FW_FIX(480),FW_FIX(390)},
- FW_kFixedBounds, // binding
- FW_kButtonPressedMsg, // control message
- FW_kFrameReceiver, // receiver
- 0, // control value
- FW_kPushButton, // button kind
- FW_SYSTEM_FONT,
- "Add"
- ),
- FW_RButton
- (
- kRemoveButtonID, // view id
- { FW_FIX(410),FW_FIX(400),FW_FIX(480),FW_FIX(420)},
- FW_kFixedBounds, // binding
- FW_kButtonPressedMsg, // control message
- FW_kFrameReceiver, // receiver
- 0, // control value
- FW_kPushButton, // button kind
- FW_SYSTEM_FONT,
- "Remove"
- ),
- FW_RPopupMenu
- (
- kBrowseTimePopupID, // view id
- { FW_FIX(30),FW_FIX(477),FW_FIX(230),FW_FIX(497)},
- FW_kFixedBounds, // binding
- FW_kPopupClickedMsg, // control message
- FW_kFrameReceiver, // control receiver
- 0, // control value
- kBrowseTimeMenuResID, // Mac menu id
- 0, // title width
- 2, // Initial menu item
- 0, // Menu variation
- 0, // Menu refCon
- FW_SYSTEM_FONT,
- "" // title
- ),
- FW_RPopupMenu
- (
- kOnlineTimePopupID, // view id
- { FW_FIX(30),FW_FIX(540),FW_FIX(230),FW_FIX(560)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- kOnlineTimeMenuResID, // Mac menu id
- 0, // title width
- 1, // Initial menu item
- 0, // Menu variation
- 0, // Menu refCon
- FW_SYSTEM_FONT,
- "" // title
- ),
- FW_RGroupBox
- (
- 0, // view id
- { FW_FIX(30),FW_FIX(580),FW_FIX(350),FW_FIX(700)},
- FW_kFixedBounds, // binding
- TIMES_12_BOLD,
- " How did you discover ODFWired?"
- ),
- FW_RButton
- (
- kWorldMouthRadioID, // view id
- { FW_FIX(40),FW_FIX(600),FW_FIX(300),FW_FIX(616)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- FW_kRadioButton, // button kind
- FW_SYSTEM_FONT,
- "Word of mouth"
- ),
- FW_RButton
- (
- kHyperLinkRadioID, // view id
- { FW_FIX(40),FW_FIX(620),FW_FIX(300),FW_FIX(636)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- FW_kRadioButton, // button kind
- FW_SYSTEM_FONT,
- "Hyperlink from another site:"
- ),
- FW_RButton
- (
- kMacTechRadioID, // view id
- { FW_FIX(40),FW_FIX(640),FW_FIX(300),FW_FIX(656)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 1, // control value
- FW_kRadioButton, // button kind
- FW_SYSTEM_FONT,
- "Ad in MacTech Magazine"
- ),
- FW_RButton
- (
- kMagazineRadioID, // view id
- { FW_FIX(40),FW_FIX(660),FW_FIX(300),FW_FIX(676)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- FW_kRadioButton, // button kind
- FW_SYSTEM_FONT,
- "Other magazine, newspaper, radio"
- ),
- FW_RButton
- (
- kOtherRadioID, // view id
- { FW_FIX(40),FW_FIX(680),FW_FIX(300),FW_FIX(696)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- FW_kRadioButton, // button kind
- FW_SYSTEM_FONT,
- "Other"
- ),
- FW_RButton
- (
- kYesRadioID, // view id
- { FW_FIX(40),FW_FIX(725),FW_FIX(100),FW_FIX(740)},
- FW_kFixedBounds, // binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- FW_kRadioButton, // button kind
- FW_SYSTEM_FONT,
- "Yes"
- ),
- FW_RButton
- (
- kNoRadioID, // view id
- { FW_FIX(40),FW_FIX(745),FW_FIX(100),FW_FIX(760)},
- FW_kFixedBounds, // binding
- FW_kButtonPressedMsg, // control message
- FW_kFrameReceiver, // control receiver
- 0, // control value
- FW_kRadioButton, // button kind
- FW_SYSTEM_FONT,
- "No"
- ),
- FW_RButton
- (
- kSubscribeButtonID, // view id
- { FW_FIX(300),FW_FIX(750),FW_FIX(450),FW_FIX(775)},
- FW_kFixedBounds, // binding
- FW_kButtonPressedMsg, // control message
- FW_kFrameReceiver, // receiver
- 0, // control value
- FW_kPushButton, // button kind
- FW_SYSTEM_FONT,
- "Join ODFWired!"
- )
- }, // End list of Subviews
-
- // RFormView adds 3 radio-clusters to FW_RSuperView
- FW_RRadioCluster
- (
- 1, // Dummy field
- { k14400RadioID, k28800RadioID, kFasterRadioID } // List of radios
- ),
- FW_RRadioCluster
- (
- 2, // Dummy field
- { kWorldMouthRadioID, kHyperLinkRadioID, kMacTechRadioID,
- kMagazineRadioID, kOtherRadioID } // List of radios
- ),
- FW_RRadioCluster
- (
- 3, // Dummy field
- { kYesRadioID, kNoRadioID } // List of radios
- )
- ), // End RFormView resource
- FW_RScrollBar // Horizontal
- (
- kHorzScrollBarID, // view id
- {-FW_ONE, V - FW_SBSIZE, H1 - FW_SBSIZE, V1}, // bounds
- FW_kHScrollBarBinding, // Standard horizontal SB binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- 0, // SB Min Value (adjusted at runtime)
- 1, // SB Max Value (adjusted at runtime)
- FW_ONE, // SB Minor Units (adjusted at runtime)
- FW_ONE // SB Major Units (adjusted at runtime)
- ),
- FW_RScrollBar // Vertical
- (
- kVertScrollBarID, // view id
- {H - FW_SBSIZE, -FW_ONE, H1, V1 - FW_SBSIZE}, // bounds
- FW_kVScrollBarBinding, // Standard vertical SB binding
- 0, // control message
- 0, // control receiver
- 0, // control value
- 0, // SB Min Value (adjusted at runtime)
- 1, // SB Max Value (adjusted at runtime)
- FW_ONE, // SB Minor Units (adjusted at runtime)
- FW_ONE // SB Major Units (adjusted at runtime)
- ),
- FW_RGrowBox
- (
- kGrowBoxID, // view Id
- {H - FW_SBSIZE, V - FW_SBSIZE, H1, V1}, // bounds
- FW_kGrowBoxBinding // standard grow box binding
- )
- }, // End list of frame's subviews
-
- { // Scroller
- FW_RScrollBarScroller
- (
- 0, // AutoScrollInset: not used here
- {0, 0} // AutoScrollIncrement: 0 = no auto-scroll
- kHorzScrollBarID, // Horizontal scroll-bar ID
- kVertScrollBarID // Vertical scroll-bar ID
- )
- }
- };
-
- //========================================================================================
- // type RPwdEditView
- //========================================================================================
- // Custom edit view to type hidden passwords
-
- type RPwdEditView : FW_REditView(Label='Pwdv')
- {
- };
-
- //========================================================================================
- // resource FW_RFrameLayout(kPasswordDialog)
- //========================================================================================
- // See constants in "FWViews.k", macros & resource types in "FWViews.fr"
-
- resource FW_RFrameLayout(kPasswordDialog)
- {
- {FW_FIX(100),FW_FIX(100)}, // LayoutSize
-
- { // Start list of frame's subviews
- FW_RStaticText
- (
- 0, // view id
- { FW_FIX(20),FW_FIX(40),FW_FIX(140),FW_FIX(60)},
- FW_kFixedBounds, // binding
- FW_NORMAL_FONT,
- "Pick a password:"
- ),
- FW_RStaticText
- (
- 0, // view id
- { FW_FIX(20),FW_FIX(70),FW_FIX(140),FW_FIX(90)},
- FW_kFixedBounds, // binding
- FW_NORMAL_FONT,
- "Retype to verify:"
- ),
- RPwdEditView // edit view to enter new password
- (
- kPasswordEditID, // view id
- { FW_FIX(150),FW_FIX(40),FW_FIX(280),FW_FIX(60)},
- FW_kFixedBounds, // binding
- 10, // max chars
- 9, // attributes
- FW_NORMAL_FONT,
- "" // initial text
- ),
- RPwdEditView // edit view to confirm password
- (
- kConfirmEditID, // view id
- { FW_FIX(150),FW_FIX(70),FW_FIX(280),FW_FIX(90)},
- FW_kFixedBounds, // binding
- 10, // max chars
- 9, // attributes
- FW_NORMAL_FONT,
- "" // initial text
- ),
- FW_RButton
- (
- kOKButtonID, // view id
- { FW_FIX(180),FW_FIX(120),FW_FIX(260),FW_FIX(148)},
- FW_kFixedBounds, // binding
- FW_kDefaultButtonMsg, // "OK" message
- 0, // receiver = dialogFrame by default
- 0, // control value
- FW_kDefaultPushButton, // button kind (with outline)
- FW_NORMAL_FONT,
- "OK"
- ),
- FW_RButton
- (
- kCancelButtonID, // view id
- { FW_FIX(60),FW_FIX(123),FW_FIX(120),FW_FIX(145)},
- FW_kFixedBounds, // binding
- FW_kCancelButtonMsg, // "Cancel" message
- 0, // receiver = dialogFrame by default
- 0, // control value
- FW_kPushButton, // button kind
- FW_NORMAL_FONT,
- "Cancel"
- )
- }, // End list of frame's subviews
- { } // no scroller
- };
-